home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / perl5 / File::stat.z / File::stat
Encoding:
Text File  |  1998-10-30  |  2.2 KB  |  67 lines

  1.  
  2.  
  3.  
  4. FFFFiiiilllleeee::::::::ssssttttaaaatttt((((3333))))                                                    FFFFiiiilllleeee::::::::ssssttttaaaatttt((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      File::stat - by-name interface to Perl's built-in _s_t_a_t() functions
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.       use File::stat;
  13.       $st = stat($file) or die "No $file: $!";
  14.       if ( ($st->mode & 0111) && $st->nlink > 1) ) {
  15.           print "$file is executable with lotsa links\n";
  16.       }
  17.  
  18.       use File::stat qw(:FIELDS);
  19.       stat($file) or die "No $file: $!";
  20.       if ( ($st_mode & 0111) && $st_nlink > 1) ) {
  21.           print "$file is executable with lotsa links\n";
  22.       }
  23.  
  24.  
  25. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  26.      This module's default exports override the core _s_t_a_t() and _l_s_t_a_t()
  27.      functions, replacing them with versions that return "File::stat" objects.
  28.      This object has methods that return the similarly named structure field
  29.      name from the _s_t_a_t(2) function; namely, dev, ino, mode, nlink, uid, gid,
  30.      rdev, size, atime, mtime, ctime, blksize, and blocks.
  31.  
  32.      You may also import all the structure fields directly into your namespace
  33.      as regular variables using the :FIELDS import tag.  (Note that this still
  34.      overrides your _s_t_a_t() and _l_s_t_a_t() functions.)  Access these fields as
  35.      variables named with a preceding st_ in front their method names.  Thus,
  36.      $stat_obj->_d_e_v() corresponds to $st_dev if you import the fields.
  37.  
  38.      To access this functionality without the core overrides, pass the use an
  39.      empty import list, and then access function functions with their full
  40.      qualified names.  On the other hand, the built-ins are still available
  41.      via the CORE:: pseudo-package.
  42.  
  43. NNNNOOOOTTTTEEEE
  44.      While this class is currently implemented using the Class::Struct module
  45.      to build a struct-like class, you shouldn't rely upon this.
  46.  
  47. AAAAUUUUTTTTHHHHOOOORRRR
  48.      Tom Christiansen
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.